<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>教室信息</title>
<meta name="decorator" content="default" />
<script src="${ctxStatic}/front/js/myValidate.js"></script>
<script src="${ctxStatic}/front/js/messages_zh.min.js"></script>
<script type="text/javascript">
	$(document).ready(
			function() {
				$("#inputForm")
						.validate(
								{
									rules : {
										schoolId: {
											required : true
										},
										capacity : {
											required : true,
											digits : true,
											min : 1
										},
										type : {
											required : true
										}
									},
									messages : {
										schoolId: {
											required : "请选择"
										},
										capacity : {
											digits : "请填写正整数",
											min : "必须大于0"
										},
										type : {
											required : "请选择"
										}
									},
									submitHandler : function(form) {
										loading('正在提交，请稍等...');
										form.submit();
									},
									errorContainer : "#messageBox",
									errorPlacement : function(error, element) {
										$("#messageBox").text("输入有误，请先更正。");
										if (element.is(":checkbox")
												|| element.is(":radio")
												|| element.parent().is(
														".input-append")) {
											error.appendTo(element.parent()
													.parent());
										} else {
											error.insertAfter(element);
										}
									}
								});
			});
</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/dd/ddClassroom/">教室列表</a></li>
		<li class="active"><a
			href="${ctx}/dd/ddClassroom/form?id=${ddClassroom.id}">教室<shiro:hasPermission
					name="dd:ddClassroom:edit">${not empty ddClassroom.id?'修改':'添加'}</shiro:hasPermission>
				<shiro:lacksPermission name="dd:ddClassroom:edit">查看</shiro:lacksPermission></a></li>
	</ul>
	<br />
	<form:form id="inputForm" modelAttribute="ddClassroom"
		action="${ctx}/dd/ddClassroom/save" method="post"
		class="form-horizontal">
		<form:hidden path="id" />
		<sys:message content="${message}" />
		<div class="control-group">
			<label class="control-label"> <b
				style="color: red; font-size: large">*</b>所属学校：
			</label>
			<div class="controls">
				<%-- <form:input path="schoolId" htmlEscape="false" maxlength="32" class="input-xlarge " required="required"/> --%>
				<form:select path="schoolId"
					class="input-mini form-control required ">
					<form:option value="">请选择</form:option>
					<form:options items="${fns:getSchoolNameList()}" itemLabel="name"
						itemValue="id" htmlEscape="false" />
				</form:select>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label"> <b
				style="color: red; font-size: large">*</b>教室名称：
			</label>
			<div class="controls">
				<form:input path="name" htmlEscape="false" maxlength="50"
					class="input-xlarge " required="required" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label"> <b
				style="color: red; font-size: large">*</b>类型：
			</label>
			<div class="controls">
				<form:select path="type" class="input-mini form-control required ">
					<form:option value="">请选择</form:option>
					<form:options items="${fns:getDictList('classroom_type')}"
						itemLabel="label" itemValue="value" htmlEscape="false" />
				</form:select>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label"> <b
				style="color: red; font-size: large">*</b>位置：
			</label>
			<div class="controls">
				<form:input path="position" htmlEscape="false" maxlength="100"
					class="input-xlarge " required="required" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label"> <b
				style="color: red; font-size: large">*</b>容纳人数：
			</label>
			<div class="controls">
				<form:input path="capacity" htmlEscape="false" maxlength="11"
					class="input-xlarge " required="required" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label"> <b
				style="color: red; font-size: large">*</b>负责人：
			</label>
			<div class="controls">
				<form:input path="director" htmlEscape="false" minlength="50"
					class="input-xlarge " required="required" />
			</div>
		</div>
		<div class="form-actions">
			<shiro:hasPermission name="dd:ddClassroom:edit">
				<input id="btnSubmit" class="btn btn-primary" type="submit"
					value="保 存" />&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回"
				onclick="history.go(-1)" />
		</div>
	</form:form>
</body>
</html>